<template>
  <div class="home_swiper">
    <Carousel v-if="banner.length > 0">
      <CarouselItem v-for="(item, index) of banner" :key="index">
        <a :href="item.href">
          <img :src="item.image" alt="" />
        </a>
      </CarouselItem>
    </Carousel>
  </div>
</template>

<script>
import { Carousel, CarouselItem } from '@/components/common/Swiper'

export default {
  name: 'HomeSwiper',
  components: {
    Carousel,
    CarouselItem
  },
  props: {
    banner: {
      type: Array,
      default () {
        return []
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.home_swiper {
  margin-top: 0.44rem;
}
</style>
